#include <iostream>
#include <map>
using namespace std;
int main() {
  map<char, int> map1;
  map<char, int>::iterator it;
  map1['a'] = 1;
  map1['b'] = 2;
  map1['c'] = 3;
  map1['d'] = 4;
  map1['e'] = 5;
  map1['f'] = 6;
  // 删除指定key的值
  map1.erase('c');
  // 删除指定迭代器位置的元素
  map1.erase(map1.begin());
  // 删除迭代器指定范围的值
  auto iter = map1.find('e');
  map1.erase(iter, map1.end());
  for (auto e : map1) {
    cout << e.first << " : " << e.second << endl;
  }
}
